// Get from db
// Store in easy to use format
include_once('assets/snippets/shoppingCart/kiwee.class.php');
$kiwee = new Kiwee();
if ($kiwee->config['cart_forcelogin'] == 'ENABLED'){
   $ret= $kiwee->getCustomerInfo($_SESSION['webInternalKey']);
}

$dbcompanyname = isset($ret['companyname']) ? $ret['companyname'] : '';
$dbfname = isset($ret['fname']) ? $ret['fname'] : '';
$dblname = isset($ret['lname']) ? $ret['lname'] : '';
$dbaddr1 = isset($ret['addr1']) ? $ret['addr1'] : '';
$dbaddr2 = isset($ret['addr2']) ? $ret['addr2'] : '';
$dbcity = isset($ret['city']) ? $ret['city'] : '';
$dbstate = isset($ret['state']) ? $ret['state'] : '';
$dbzip = isset($ret['zip']) ? $ret['zip'] : '';
$dbcountry = isset($ret['country']) ? $ret['country'] : '';
$dbphone = isset($ret['phone_1']) ? $ret['phone_1'] : '';
$dbext = isset($ret['ext_1']) ? $ret['ext_1'] : '';
$dbfax = isset($ret['fax']) ? $ret['fax'] : '';
$dbemail = isset($_SESSION['webEmail']) ? $_SESSION['webEmail'] : '';

echo '<div id="CheckoutFormDiv" style="width: 95%; ">';
echo '<div id="BillingInfoTitle" style="margin-left: auto; margin-right: auto; width:610px; height: 25px; padding-top: 5px; padding-left: 10px; background-color: #497AFF; color: #FFF; font-size: 16px; font-weight: bold;">Billing Information</div>';
echo '<div id="BillingInfoDetail" style="margin-left: auto; margin-right: auto; width: 600px; height: 230px; padding: 10px; background-color: #E3E8E8;">';
echo '<table>';
echo '	   <tr>';
echo '	   	   <td>';
echo '<div id="emaillabel" style="color: #54534C; font-size: 14px; font-weight: bold;">Email:*</div>';
echo '		   </td>';
echo '		   <td>';
echo '<div id="emailfield" style="padding-left: 25px;"><input tabindex="1" type="text" id="emailbilling" size="35" value="'. $dbemail . '" /></div>';
echo '		   </td>';
echo '	   </tr>';
echo '     <tr>';
echo ' 	   		 <td>';
echo '<div id="companylabel" style="color: #54534C; font-size: 14px; font-weight: bold;">Company:</div>';
echo '	   		 </td>';
echo ' 	   		 <td>';
echo '<div id="companyfield" style="padding-left: 25px;"><input tabindex="2" type="text" id="companybilling" size="35" value="'. $dbcompanyname . '" /></div>';
echo '	   		 </td>';

echo '	   </tr>';
echo '</table>';
echo '<table>';
echo '     <tr>';
echo ' 	   		 <td>';
echo '<div id="fnamelabel" style="color: #54534C; font-size: 14px; font-weight: bold;">First Name:*</div>';
echo '	   		 </td>';
echo ' 	   		 <td style="padding-left: 9px;" background-color: #ff9933;">';
echo '<div id="fnamefield" style=""><input tabindex="3" type="text" id="fnamebilling" value="'. $dbfname . '"/></div>';
echo '	   		 </td>';
echo ' 	   		 <td>';
echo '<div id="lnamelabel" style="padding-left: 5px; color: #54534C; font-size: 14px; font-weight: bold;">Last Name:*</div>';
echo '	   		 </td>';
echo ' 	   		 <td>';
echo '<div id="lnamefield" style=""><input tabindex="4" type="text" id="lnamebilling" value="'. $dblname . '"/></div>';
echo '	   		 </td>';
echo '	   </tr>';
echo '</table>';
echo '<table>';
echo '     <tr>';
echo ' 	   		 <td>';
echo '<div id="addr1label" style="float:left;  color: #54534C; font-size: 14px; font-weight: bold;">Address:*</div>';
echo '	   		 </td>';
echo ' 	   		 <td>';
echo '<div id="addr1field" style="padding-left: 24px;"><input tabindex="5" type="text" id="addr1billing" size="41" value="'. $dbaddr1 . '"/></div>';
echo '	   		 </td>';

echo '	   </tr>';
echo '     <tr>';
echo ' 	   		 <td>';
echo '<div id="addr2label" style="color: #54534C; font-size: 14px; font-weight: bold;">Address 2:</div>';
echo '	   		 </td>';
echo ' 	   		 <td>';
echo '<div id="addr2field" style="padding-left: 24px;"><input tabindex="6" type="text" id="addr2billing" size="41" value="'. $dbaddr2 . '"/></div>';
echo '	   		 </td>';
echo '	   </tr>';
echo '</table>';
echo '<table>';
echo '     <tr>';
echo ' 	   		 <td>';
echo '<div id="citylabel" style="color: #54534C; font-size: 14px; font-weight: bold;">City:*</div>';
echo '	   		 </td>';
echo ' 	   		 <td>';
echo '<div id="cityfield" style="padding-left: 40px; "><input tabindex="7" type="text" id="citybilling" value="'. $dbcity . '"/></div>';
echo '	   		 </td>';
echo ' 	   		 <td>';
echo '<div id="statelabel" style="padding-left: 40px; color: #54534C; font-size: 14px; font-weight: bold;">State:*</div>';
echo '	   		 </td>';
echo ' 	   		 <td>';
echo '<div id="statefield" style=""><input tabindex="8" type="text" size="5" id="statebilling" value="'. $dbstate . '"/></div>';
echo '	   		 </td>';
echo ' 	   		 <td>';
echo '<div id="ziplabel" style="padding-left: 15px; color: #54534C; font-size: 14px; font-weight: bold; ">Zip:*</div>';
echo '	   		 </td>';
echo ' 	   		 <td>';
echo '<div id="zipfield" style=""><input tabindex="9" type="text" size="5" id="zipbilling" value="'. $dbzip . '"/></div>';
echo '	   		 </td>';
echo '	   </tr>';
echo '     <tr>';
echo ' 	   		 <td>';
echo '<div id="phonelabel" style="color: #54534C; font-size: 14px; font-weight: bold;">Phone:*</div>';
echo '	   		 </td>';
echo ' 	   		 <td>';
echo '<div id="phonefield" style="padding-left: 40px;"><input tabindex="10" type="text" id="phonebilling" value="'. $dbphone . '"/></div>';
echo '	   		 </td>';
echo ' 	   		 <td>';
echo '<div id="extlabel" style="padding-left: 40px; color: #54534C; font-size: 14px; font-weight: bold;">Ext:</div>';
echo '	   		 </td>';
echo ' 	   		 <td>';
echo '<div id="extfield" style=""><input tabindex="11" type="text" size="5" id="extbilling" value="'. $dbext .'"></div>';
echo '	   		 </td>';
echo '	   </tr>';
echo '</table>';
echo '<table>';
echo '<tr>';
echo '<td>';
echo '<div id="faxlabel" style="color: #54534C; font-size: 14px; font-weight: bold;">Fax:</div>';
echo '</td>';
echo '<td>';
echo '<div id="faxfield" style="padding-left: 64px;"><input tabindex="12" type="text" id="faxbilling" value="'. $dbfax . '"/></div>';
echo '</td>';
echo '<td>';
echo '<div id="shipsamefield" style="padding-left: 35px;"><input tabindex="13" unchecked id="shipsamecheckbox" type="checkbox" onClick="showshipping();"/></div>';
echo '</td>';
echo '<td>';
echo '<div id="shipsamelabel" style="padding-left: 10px; font-size: 14px; color: #54534C; font-weight: bold;" />Ship to Same Address</div>';
echo '</td>';
echo '</tr>';
echo '</table>';

echo '</div>';

echo '<br />';
echo '</div>';
echo '<br />';
